﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IvashenkoConfigLoaderTets.cs" company="dimamartovoi">
//   Apache License
//   Version 2.0, January 2004
//   http://www.apache.org/licenses
// </copyright>
// <summary>
//   The simple config loader tets.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System.IO;

using ActorModel.Infrastructure;
using ActorModel.Infrastructure.Configuration.Ivashenko;

using NUnit.Framework;

namespace IvashenkoConfigLoaderTests
{
    /// <summary>
    ///     The simple config loader tets.
    /// </summary>
    [TestFixture]
    public class IvashenkoConfigLoaderTets
    {
        #region Public Methods and Operators

        /// <summary>
        ///     The load parameters.
        /// </summary>
        [Test]
        public void LoadParameters()
        {
            string codePath = Path.Combine(
                TestContext.CurrentContext.WorkDirectory, @"EvolutionTestSamples\sample1.evol");
            string code = File.ReadAllText(codePath);
            var loader = new IvashenkoConfigLoader();
            EngineStartParameters<string> parameters = loader.Load(code);

            Assert.IsTrue(parameters.NumberOfNodes == 2);
            Assert.IsTrue(parameters.NumberOfNodeConnectors == 2);
            Assert.IsTrue(parameters.ConnectorsInfo.Count == 4);
        }

        #endregion
    }
}